writing data into text file